package com.chentf.injection;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author chentengfei
 * @desc ...
 * @date 2021-02-11 10:11:33
 */
@Component
@Data
@PropertySource("classpath:/init.properties") //代替spring配置文件中的配置
public class Category {
    @Value("${id}")
    private int id;
    @Value("${name}")
    private String name;
}
